/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.aqlm.data;

import java.util.List;
import org.rainbow.annotation.xml.NodeText;

/**
 *
 * @author hironaga
 */
public class CourseUDO {

    @NodeText( elementName="menu" )
    private String menuId;

    @NodeText( elementName="option01" )
    private String option01Id;

    @NodeText( elementName="option02" )
    private String option02Id;

    @NodeText( elementName="option03" )
    private String option03Id;

    public MenuUDO getMenu(MenuList menuList){
        List<MenuUDO> menus = menuList.getMenuList();
        for(MenuUDO menu : menus){
            if(menu.getId().equals(this.menuId)){
                return menu;
            }
        }
        return null;
    }

    public MenuUDO getOption01(MenuList menuList){
        List<MenuUDO> option01List = menuList.getOptionList01();
        for(MenuUDO menu : option01List){
            if(menu.getId().equals(this.option01Id)){
                return menu;
            }
        }
        return null;
    }

    public MenuUDO getOption02(MenuList menuList){
        List<MenuUDO> option02List = menuList.getOptionList02();
        for(MenuUDO menu : option02List){
            if(menu.getId().equals(this.option02Id)){
                return menu;
            }
        }
        return null;
    }

    public MenuUDO getOption03(MenuList menuList){
        List<MenuUDO> option03List = menuList.getOptionList03();
        for(MenuUDO menu : option03List){
            if(menu.getId().equals(this.option03Id)){
                return menu;
            }
        }
        return null;
    }

    @Override
    public String toString(){
        return //super.toString() +
                "menuId:" + this.menuId +
                ", option01Id:" + this.option01Id +
                ", option02Id:" + this.option02Id +
                ", option03Id:" + this.option03Id;
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getOption01Id() {
        return option01Id;
    }

    public void setOption01Id(String option01Id) {
        this.option01Id = option01Id;
    }

    public String getOption02Id() {
        return option02Id;
    }

    public void setOption02Id(String option02Id) {
        this.option02Id = option02Id;
    }

    public String getOption03Id() {
        return option03Id;
    }

    public void setOption03Id(String option03Id) {
        this.option03Id = option03Id;
    }

}
